#ifndef SCOREKEEPERSCREEN_H
#define SCOREKEEPERSCREEN_H

#include <QWidget>
#include <QObject>
#include "scorekeeper.h"
#include "player.h"
#include <QGraphicsScene>
#include "playericon.h"
#include "base.h"
#include <QList>
#include "memento.h"
#include "gameoverscreen.h"

namespace Ui {
class ScoreKeeperScreen;
}

class ScoreKeeperScreen : public QWidget
{
    Q_OBJECT
    
public:
    explicit ScoreKeeperScreen(QWidget *parent = 0);
    ScoreKeeperScreen(QVector<Player*> homeLineup, int homePitcher, QVector<Player*> awayLineup, int awayPitcher);
    ScoreKeeperScreen(ScoreKeeperScreen* other);
    ~ScoreKeeperScreen();
    ScoreKeeper* keeper;
    QList<PlayerIcon*> playersOnField;

private:
    Ui::ScoreKeeperScreen *ui;
    void updateValues();
    void clearBases();
    void spawnPlayer();
    QGraphicsScene* theScene;
    void manageBases();
    void updateKeeperBases(Player* p);
    void endGame();

    Base* homeBase;
    Base* firstBase;
    Base* secondBase;
    Base* thirdBase;

    Memento* undoer;

public slots:
    void strike();
    void foul();
    void ball();
    void pitch();
    void ballInPlay();
    void homerun();
    void single();
    void hitDouble();
    void triple();
    void out();
    void viewStats();
    void undo();
};

#endif // SCOREKEEPERSCREEN_H
